# 读取documnets文档
$documentsPath = [Environment]::GetFolderPath("MyDocuments");
# 拼接备份文件位置
$bakFilePath = Join-Path -Path $documentsPath -ChildPath "qgy/host_bak.txt";
# 读取整个文件内容
$bakContent = Get-Content -Path $bakFilePath
# 读取githubIP
$response = Invoke-WebRequest -Uri "https://raw.hellogithub.com/hosts";
$body = [System.Text.Encoding]::UTF8.GetString($response.Content);
$text = $bakContent + $body
$text > 'C:\Windows\System32\drivers\etc\hosts'
ipconfig.exe /flushdns